package cnitcast;

import java.io.*;
import java.net.InetAddress;
import java.net.Socket;

//客户端
public class Client {
    public static void main(String[] args) throws IOException {
        InetAddress inetAddress=InetAddress.getByName("127.0.0.1");
        Socket socket=new Socket(inetAddress,9875);
        OutputStream os=socket.getOutputStream();
        FileInputStream is=new FileInputStream("Libs/a.jpg");
        byte [] bus=new byte[1024];
        int len;
        while ((len = is.read(bus)) != -1) {
            os.write(bus,0,len);
        }
        is.close();
        os.close();
        socket.close();
    }
}
